<template>
  <div class="app-container">
    <div class="header">
      <el-button type="primary">一键修改</el-button>
    </div>
    <el-table
      v-loading="listLoading"
      :data="list"
      element-loading-text="Loading"
      border
      fit
      highlight-current-row
    >
      <el-table-column align="center" label="序号" width="120">
        <template slot-scope="scope">
          {{ scope.$index }}
        </template>
      </el-table-column>
      <el-table-column label="时间" width="200" align="center">
        <template slot-scope="scope">
          <span>{{ scope.row.time }}</span>
        </template>
      </el-table-column>
      <el-table-column label="优秀率" width="200" align="center">
        <template slot-scope="scope">
          <span>{{ scope.row.excellent }}%</span>
        </template>
      </el-table-column>
      <el-table-column label="良好率" align="center">
        <template slot-scope="scope">
          <span>{{ scope.row.good }}%</span>
        </template>
      </el-table-column>
      <el-table-column label="合格率" align="center">
        <template slot-scope="scope">
          <span>{{ scope.row.qualified }}%</span>
        </template>
      </el-table-column>
      <el-table-column label="不合格率" align="center">
        <template slot-scope="scope">
          <span>{{ scope.row.unqualified }}%</span>
        </template>
      </el-table-column>
    </el-table>
  </div>
</template>
<script>
import * as handle from '@/api/handle'

export default {
  data() {
    return {
      list: null,
      listLoading: true
    }
  },
  created() {
    this.fetchData()
  },
  methods: {
    fetchData() {
      this.listLoading = true
      handle.list().then(response => {
        this.list = response.data
        this.listLoading = false
      })
    }
  }
}
</script>

<style>
.header{
  margin-bottom: 10px;
}
</style>
